package com.chitang.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chitang.domain.TrolleyInfo;
import com.chitang.mapper.TrolleyInfoMapper;
import com.chitang.service.TrolleyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
* @author 0507
* @description 针对表【b_trolley_info(台车信息表)】的数据库操作Service实现
* @createDate 2023-02-20 12:49:30
*/
@Service
public class TrolleyInfoServiceImpl extends ServiceImpl<TrolleyInfoMapper, TrolleyInfo>
    implements TrolleyInfoService {
    @Autowired
    private TrolleyInfoMapper trolleyInfoMapper;

    @Override
    public void sync2Es(List<TrolleyInfo> dataList) {
        for (TrolleyInfo trolleyInfo : dataList) {
            trolleyInfo.setUpdateTime(new Date());
            trolleyInfoMapper.updateById(trolleyInfo);
        }
    }
}




